<?php
include_once(ROOT_PATH . 'includes/cls_image.php');
$image = new cls_image($_CFG['bgcolor']);
$type = _POST('type', 'app');
in_array($type, ['app']) || $type = 'app';
if (!is_dir(ROOT_PATH.'/data/'.$type))
{
    mkdir(ROOT_PATH.'/data/'.$type);
}
return $image->upload_image($_FILES['file'], $type);